home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 10
/
AACD 10.iso
/
AACD
/
System
/
SafeSwitch
/
SafeSwitch.readme
< prev
next >
Wrap
Text File
|
2000-05-26
|
5KB
|
127 lines
Short: Patch for screen switching lock-ups
Uploader: rennex@icon.fi (Renne Nissinen)
Author: rennex@icon.fi (Renne Nissinen)
Type: util/misc
Version: 1.0
Introduction
There's a bug in AmigaOS, or maybe in some common utility,
that causes the Amiga to hang if you switch screens when
a window is just about to open. For some reason this
doesn't happen on all systems but I have suffered from this
common bug for ages, and I know several other people have
too.
Then, one day I had enough and decided that I had to at
least try fixing it. Since disassembling library functions
would be tedious work, I decided to try patching a couple
of library functions involved with screens and windows.
And whaddaya know, after a couple of tries it worked! :)
SafeSwitch
This small program patches some intuition.library functions
to wait for their turn, so a screen can't be switched when
some process is opening a window. I don't know exactly what
causes the lock-ups in the first place, but since this patch
seems to work just fine I decided to release it. It is
freeware and the assembler source code is included. All I
ask is that you email me whether it works or not :) You'll
find my address below.
Like I wrote above, some systems don't have this bug. For
example, I have been told that CGFX patches intuition's
functions in the same way as SafeSwitch, but I don't
have it myself so I can't be sure. Test for yourself and
please, email me whatever you find!
Usage & Installation
You just copy SafeSwitch to your hard disk and run it. For
example, copy it to C: and add "run <>nil: C:SafeSwitch" to
your S:user-startup. If you have SetMan or some other
SetFunction manager installed, be sure to run SafeSwitch
after running the manager.
You can quit the program by sending it a ctrl-c, but if
you don't have a SetFunction manager installed, quitting
SafeSwitch might crash your system!
SafeSwitch requires AmigaOS 2.04, but it has only been
tested on AmigaOS 3.0.
Testing
You can test how SafeSwitch affects your machine with the
DelayWindow program that is included in this archive. After
you run it, it waits for one second and then opens a window
and closes it soon after. So save all your work, *don't* run
SafeSwitch yet and open 2 or more screens. Run DelayWindow
and immediately start switching screens as fast as possible,
with the screen depth button or by pressing LAmiga+M. When
the window opens after a second, your machine should hang :)
If it doesn't, try a couple more times. If it still doesn't
hang, then either you're too slow or you don't need this
patch :) If it does hang, reboot your Amiga and try again
with the patch running and see if it hangs any more! And
don't forget to email me the results :)
Mystery
The mysterious part about this patch is that when I run it
once and then quit it, I can't get screen switching to hang
any more until I reboot... I have no idea why this happens,
and the best explanation I can think of is that SetMan is
actually the cause for the hangs and patching some Intuition
functions removes the thing that SetMan has done wrong. :)
About the source code
SafeSwitch sets up a semaphore, patches the functions
ScreenToFront, ScreenToBack, WBenchToFront, WBenchToBack,
ScreenDepth, OpenWindow and OpenWindowTagList in Intuition
and starts waiting for messages. The patched functions
attempt to obtain the semaphore, and if they succeed then
they'll call the original function and release the semaphore.
But if they can't obtain it, they send a message to the main
program and return immediately, and the main program will call
the function when the semaphore is released. Only the two
OpenWindow calls won't return until they get their jobs done.
The replacement functions aren't optimized to the max, but
I actually wrote the code months ago and since it's not
broken, I decided not to try and fix it :)
Contact & Updates
Don't hesitate to send all comments, suggestions, bug reports,
improvements and any other info about SafeSwitch to my email
address below. Even if you just find the patch useful or useless,
I'd like to know :) I'd also like to know what OS version and
CPU you have, and whether or not you are using SetMan.
See the SafeSwitch homepage for possible updates! I will also
mail everyone who has shown interest in SafeSwitch about all
future updates.
The current addresses are:
rennex@icon.fi
www.icon.fi/~rennex/safeswitch
But after June 2000 I should have new, permanent addresses:
rennex@iki.fi
www.iki.fi/~rennex/safeswitch